Embedded Integration Code
PHP, Node.js, Python, and Java examples for embedded (S2S) checkout.
Embedded Integration gives you full control over the checkout experience by allowing you to collect payment details on your own website and securely process payments through DigetPay Server-to-Server (S2S) APIs.
Unlike Hosted Checkout, your application owns the checkout UI, customer experience, and payment flow.
What you'll build
This guide provides complete server-side examples for:
- Request Hash (MD5) generation
- Direct Sale (S2S)
- 3-D Secure (3DS) handling
- Transaction Status verification
- Capture & Void operations
- Webhook processing
- Apple Pay integration (separate flow)
Before you beginMake sure you have:
- A merchant account with access to the Merchant Dashboard (pay.digetpay.com)
- Your Test API Key (
x-api-key)- Backend application (PHP, Node.js, Python, or Java)
- HTTPS-enabled endpoints
- Basic knowledge of REST APIs
All examples use the API base URL
https://api.digetpay.com/v1, which is the same for Test and Live. Use Test Cards only in Test Mode.
PCI DSS RequirementEmbedded Integration requires your application to securely handle payment card data.
This integration is suitable only for merchants that meet PCI DSS (SAQ D or equivalent) requirements.
If your business does not require a fully customized checkout experience, we strongly recommend using Hosted Checkout to reduce PCI scope.
Security NoticeNever send card data directly from browser JavaScript to DigetPay.
The recommended flow is:
Customer → Your Backend → DigetPay API
Your backend should:
- Generate the request hash
- Send payment requests
- Handle 3-D Secure responses
- Process webhook notifications
- Verify transaction status with the Status API before fulfilling an order
Integration Flow
flowchart LR
A[Customer Checkout]
B[Merchant Backend]
C[Generate Request Hash]
D[Direct Sale API]
E{Response}
F[Approved]
G[3-D Secure]
H[Declined]
I[Webhook notification]
J[Transaction Status]
K[Update Order]
A --> B
B --> C
C --> D
D --> E
E --> F
E --> G
E --> H
F --> I
G --> I
I --> J
J --> K
Apple Pay
Apple Pay for Embedded Integration uses a dedicated implementation.
Unlike Hosted Checkout, your application is responsible for displaying the Apple Pay button, creating the payment session, and submitting the payment token.
Related Guides
Updated about 2 months ago

